package com.zhu.transaction.mapper;

import com.zhu.transaction.pojo.Category;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author zhu
 * @since 2021-01-07
 */
public interface CategoryMapper {

    //添加分类
    int addCategory(Category category);

    //查询一级分类
    Category queryFirstCategory(String categoryName);

    //通过Id查询分类
    Category queryCategoryById(String id);

    //通过父Id查询分类列表
    List<Category> queryCategoryByParent(String parent);

    //删除分类
    int deleteCategoryById(String id);

    //更新分类信息
    int updateCategory(@Param("id") String id, @Param("categoryName") String categoryName);
}
